** result of spatial join in arc
** will be modified into adm4 python script
**

// Get the path of the currently running do-file
local do_file_path `c(pwd)'

// Change the working directory to the location of the do-file
cd "`do_file_path'"

cd "local\gis_data\003_boundaries"

import dbase using "fishnet_pt_all_with_NER_adm4_feb2018.dbf", clear

rename JOINID objectid
rename Distance distance
keep if GID_0=="NER"

gen alignadm4 = 1 if distance>0
replace alignadm4 = 0 if distance==0

keep objectid gid_4 name_4 alignadm4

** objectid
**12529.00000000000
**13135.00000000000
**14824.00000000000
**14825.00000000000
**15045.00000000000
**15046.00000000000

label variable alignadm4 "Alignment issue with pixel center and NER adm4 boundaries : OCHA"

cd "`do_file_path'"

cd "proc_data"
save "NER_ADM4.dta", replace